package acm.同步赛4;

import java.util.Arrays;
import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        int[] count=new int[n];
        int[][] nums=new int[n][];
        for (int[] num : nums) {
            num=new int[sc.nextInt()];
        }
        for (int i = 0; i < nums.length; i++) {
            int c = sc.nextInt();
            nums[i]=new int[c];
            count[i]=c*10;
        }
        int rank=1;
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums[i].length; j++) {
                if (count[i]-->0){
                    nums[i][j]=rank;//后续所有学校都还有学生的情况
                    i++;
                }
            }
        }
    }
}
